#include"khaibao.h"
void Input()
{
	Student st[3];
	strcpy(st[0].name,"Nguyen Anh");
	strcpy(st[0].numberstudent,"ccq1211A");
	strcpy(st[0].address,"Hai Ba Trung/Quan 9");
	st[0].old=21;
	st[0].birthday.day=22;
	st[0].birthday.month=5;
	st[0].birthday.year=1980;

	strcpy(st[1].name,"Nguyen Anh");
	strcpy(st[1].numberstudent,"ccq1211B");
	strcpy(st[1].address,"Hai Ba Trung/Quan 9");
	st[1].old=23;
	st[1].birthday.day=22;
	st[1].birthday.month=5;
	st[1].birthday.year=2014;

	strcpy(st[2].name,"Nguyen Anh");
	strcpy(st[2].numberstudent,"ccq1211C");
	strcpy(st[2].address,"Hai Ba Trung/Quan 9");
	st[2].old=23;
	st[2].birthday.day=22;
	st[2].birthday.month=5;
	st[2].birthday.year=2002;
	ofstream outfile("Student.data",ios::binary);
	outfile.write((char *)&st,sizeof(st));
	outfile.close();

	ifstream infile("Student.data",ios::binary);
	Student st1[3];
	infile.read((char*)&st1,sizeof(st1));
	for(size_t i=0;i<3;i++)
	{
		cout<<"\nstt"<<i;
		cout<<"\nName:"<<st1[i].name;
		cout<<"\nNumberstudent:"<<st1[i].numberstudent;
		cout<<"\nAddress:"<<st1[i].address;
		cout<<"\nBirthday:"<<st[i].birthday.day<<"/"<<st1[i].birthday.month<<"/"<<st1[i].birthday.year<<endl;
	}
	infile.close();
}


